package com.iteaj.framework.spring.boot.config;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.LiveBeansView;
import org.springframework.core.env.Environment;

@Configuration
@EnableConfigurationProperties({FrameworkProperties.class})
public class FrameworkConfiguration implements EnvironmentAware {

    @Override
    public void setEnvironment(Environment environment) {
        String property = environment.getProperty("spring.liveBeansView.mbeanDomain");
        String applicationName = environment.getProperty("spring.application.name");
        System.setProperty(LiveBeansView.MBEAN_DOMAIN_PROPERTY_NAME, applicationName);
    }
}

